<?php

declare(strict_types=1);

/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;
use Hyperf\SocketIOServer\Collector\SocketIORouter;
use App\Controller\WebSocketController;

//自动加载路由文件夹
//"/config/routes/*
//reloadRoute();



//http的
Router::addGroup('/api/v1', function () {
//    获取营业时间
        Router::addRoute(['get'], '/on_msg', 'App\Controller\WssController@on_msg');
        Router::addRoute(['get'], '/black_list', 'App\Controller\WssController@black_list');
        Router::addRoute(['get'], '/top', 'App\Controller\WssController@top');
}, ['middleware' => [
//    \App\Middleware\Auth::class
]]);

//websocket的
Router::addServer('ws', function () {
    Router::addRoute(['get'],'/user', 'App\Controller\WebSocketController');
    },
    [
        'middleware' => [
            \App\Middleware\Auth::class
        ]
    ]
);


Router::addServer('ws', function () {
    Router::get('/shop', 'App\Controller\WssController');
    }, ['middleware' => [
            \App\Middleware\Auth::class
    ]]
);


